#include "usbproto.h"

VOID UsbSendStatus(UINT32 Status, PVOID Data, SIZE DataLength)
{
    PACKET_HEADER Header;
    Header.Magic = PACKET_HEADER_MAGIC;
    Header.Type = DataLength > 0 ? PT_STATUS_DATA : PT_STATUS;
    Header.DataLength = sizeof(Status) + DataLength;
    Header.Serial = 0;

    mt_usbtty_putcn(PACKET_HEADER_SIZE, (char *)&Header, 1 /* 0 */);
    mt_usbtty_putcn(sizeof(Status), (char *)&Status, 1 /* DataLength > 0 ? 1 : 0 */);
    if (DataLength > 0)
        mt_usbtty_putcn(DataLength, (char *)Data, 1);
}